<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="common/include :: header('新增服务')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-post-add">
			<input type="hidden" name="id" th:value="${serviceItem.id}">
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">服务项名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" th:value="${serviceItem.name}" id="serviceItemName" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">服务项原价：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="originalPrice" th:value="${serviceItem.originalPrice}" id="serviceItemCode" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">服务项折扣价：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="discountPrice" th:value="${serviceItem.discountPrice}" id="discountPriceCode" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">服务分类：</label>
				<div class="col-sm-8">
					<select class="form-control" th:field="${serviceItem.serviceCatalog}" name="serviceCatalog" th:with="type=${@dict.getType('si_service_catalog')}">
						<option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}"></option>
					</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label is-required">备注：</label>
				<div class="col-sm-8">
					<textarea type="text" name="info" th:text="${serviceItem.info}" class="form-control"></textarea>
				</div>
				<!--文本域回显要用 text 回显(th:text)-->
			</div>



		</form>
	</div>
	<th:block th:include="common/include :: footer" />
	<script type="text/javascript">
		var prefix = ctx + "/business/serviceItem";

		
		function submitHandler() {
	        if ($.validate.form()) {
	        	// save 其实就是发送ajax请求
	        	$.operate.save(prefix + "/edit", $('#form-post-add').serialize());
	        }
	    }

	</script>
</body>
</html>
